// pages/Index/Customer/VIPCardList.js
const app = getApp();
const controller=require("../../controllers/Controller").controller
Page({
  data: {
    dataList:[],
    startTime:"2020-01-01",
    endTime:"2020-01-01",
    state:"",
    stateList:["全部","未完结","已完结"],
    selectState:"全部"
    
  },
  onLoad: function (options) {
    if(options.userId){
      this.setData({
        userId:options.userId,
        shopId:options.shopId
      })
    }
    this.defaultGetList()
  },
  defaultGetList(){
    let searchKey = this.data.searchKey||"";
    let that = this; 
    controller.checkLookVIPlist({
      sessionId: wx.getStorageSync('token'),
      shopId:this.data.shopId,
      accountId: this.data.userId,
    }).then(res =>{
      that.setData({
        dataList:res.data
        });
    });
  },
  openCard() {
    wx.navigateTo({
      url: '../OpenCard/OpenCard',
    })
  },
   
  toUrl(e) {
    let id=e.currentTarget.dataset.id
    wx.navigateTo({
      url: "/pages/Index/Customer/VIPCardInfo?id="+id+"&shopId="+this.data.shopId
    });
  }

})